package cn.itcast.service.impl;

import cn.itcast.dao.AreaDao;
import cn.itcast.domain.PriceArea;
import cn.itcast.domain.PriceRange;
import cn.itcast.domain.PriceTrend;
import cn.itcast.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AreaServiceImpl implements AreaService {
  @Autowired
  private AreaDao areaDao;

  public List<PriceArea> findAreaPrice(String city){
    return areaDao.findByCity(city);
  }

  public List<PriceTrend> findTrendPrice(String area){
    return areaDao.findByPriceArea(area);
  }

  public List<PriceRange> findRangePrice(int minprice, int maxprice){
    return areaDao.findByPriceRange(minprice, maxprice);
  }
}
